package com.jsh.erp.api;

import com.jsh.erp.datasource.entities.DepotHead;
import com.jsh.erp.datasource.mappers.DepotHeadMapperEx;
import com.jsh.erp.service.depotHead.DepotHeadService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/api/depotHeadApi")
public class DepotHeadApi {

    @Resource
    private DepotHeadMapperEx depotHeadMapperEx;
    @Resource
    private DepotHeadService depotHeadService;

    @GetMapping("/getDepotHeadListByAccountIds")
    public List<DepotHead> getDepotHeadListByAccountIds(String[] accountIds){
        return depotHeadMapperEx.getDepotHeadListByAccountIds(accountIds);
    }

    @GetMapping("/getDepotHead")
    public DepotHead getDepotHead( String number) throws Exception{
        return depotHeadService.getDepotHead(number);
    }
}
